﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace SocialPlatformSDK.Services
{
    public static class FactoryHelper
    {
        public static IOAuthService GetOAuthServiceByName(string name)
        {
            IOAuthService service = null;

            if (name == "Tencent")
            {
                service = new OAuthService< TencentAccessToken>(TencentOAuthInfo.Instance);
                return service;
            }
            if (name == "Sina")
            {
                service = new OAuthService< SinaAccessToken>(SinaOAuthInfo.Instance);
                return service;
            }

            if (name == "RenRen")
            {
                service = new OAuthService<RenRenAccessToken>(RenRenOAuthInfo.Instance);
                return service;
            }
            return service;

        }

        public static ISocialFactory GetSocialFactoryByName(string name)
        {
            ISocialFactory socialFactory = null;
            if (name == "Tencent")
            {
                socialFactory = TencentSocFactory.Instance;
                return socialFactory;
            }

            if (name == "Sina")
            {
                socialFactory = SinaSocFactory.Instance;
                return socialFactory;
            }

            if (name == "RenRen")
            {
                socialFactory = RenRenSocFactory.Instance;
                return socialFactory;
            }
            return socialFactory;
        }



        //public static IService GetBaseServiceByName(string name)
        //{
        //    IService service = null;

        //    if (name == "Tencent")
        //    {
        //        service=new TencentAPIService<TencentServiceArgument>();
        //        return service;
        //    }
        //    return service;

        //}
    }
}
